package com.wwj.utils;

import org.springframework.core.io.Resource;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * Created by xya on 17-3-15.
 */
public class PropertiesUtils {

    private Properties pros = null;

    public PropertiesUtils(Resource resource) {
        pros = new Properties();
        try {
            InputStream in = resource.getInputStream();
            pros.load(in);//Load the file Properties to flow to the object
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public String get(String key) {
        return pros.getProperty(key);
    }
}
